package Deom;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 周斌
 * Date: 2023-11-25
 * Time: 20:38
 */
public class Computer {
    //打开电脑
    public void OpenOn() {
        System.out.println("打开电脑");
    }
    //打开鼠标和键盘设置
    public void Device(Iusb iusb) {
        if(iusb instanceof Mouse) {
            Mouse mouse = (Mouse) iusb;
            mouse.openDevice();
            mouse.click();
            mouse.closeDevice();
        }
        if(iusb instanceof  KeyBoard) {
            KeyBoard keyBoard = (KeyBoard) iusb;
            keyBoard.openDevice();
            keyBoard.knock();
            keyBoard.closeDevice();
        }
    }
    //关闭电脑
    public void OpenOff() {
        System.out.println("关闭电脑");
    }
}
